<template>
    <div class="app-container">
        
        <el-tabs type="border-card" v-model="tabName" @tab-change="tabChange">
            <el-tab-pane lazy label="病人信息">
                <Sickperson></Sickperson>
            </el-tab-pane>
            <el-tab-pane lazy label="术中事件">
                <Eventing v-if="tabName==1"></Eventing>
            </el-tab-pane>
            <el-tab-pane lazy label="护理事件">Role</el-tab-pane>
            <el-tab-pane label="器械清点">
                <Device></Device>
            </el-tab-pane>
            <el-tab-pane lazy label="体外循环">Task</el-tab-pane>
            <el-tab-pane lazy label="医嘱执行">Task</el-tab-pane>
            <el-tab-pane lazy label="交接班">
                <Workchange></Workchange>
            </el-tab-pane>
            <el-tab-pane lazy label="收费统计">Task</el-tab-pane>
            <el-tab-pane lazy label="患者360">Task</el-tab-pane>
            <el-tab-pane lazy label="结束手术">
                <Endsurgery></Endsurgery>
            </el-tab-pane>
            <el-tab-pane lazy label="术后登记">Task</el-tab-pane>
        </el-tabs>
    </div>
</template>

<script setup name="surgerying">
    import useSurgeryingStore from '@/store/modules/surgerying'
    import { listSurgeryevent} from "@/api/manage/eventsurgery";
    import Eventing from './eventing.vue'
    import Device from './device.vue'
    import Workchange from './workchange.vue'
    import Endsurgery from './endsurgery.vue';
    import Sickperson from './sickperson.vue';
    let tabName=ref('0');
    if(sessionStorage.getItem('surgerying-tab')){

        tabName.value=sessionStorage.getItem('surgerying-tab');

    }
    function tabChange(){
        sessionStorage.setItem('surgerying-tab',tabName.value)
    }

    function initData(){
        getStoreEvent()
    }
    function getStoreEvent(){
   
      
        listSurgeryevent({
            pageNum:1,
            surgeryId:useSurgeryingStore().surgerying.surgeryId,
            pageSize:100
        }).then(res=>{
            useSurgeryingStore().setEventList(res.rows)
            // activities.value=res.rows 
            // if(res.rows.length){
            //     selectEvent(res.rows[0])
            // }

        })
    }

    //initData()

</script>




















<style lang="scss" scoped>
    .app-container{
        background:#fff;
        height:100%;
    }
    .page-wrap{
        height:100%;
        display:flex;
    }
</style>